<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:67:"/var/www/html/CRM/public/../application/admin/view/spread/user.html";i:1540979870;}*/ ?>
﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理员管理-有点</title>
<link rel="stylesheet" type="text/css" href="/admin/css/css.css" />
<script type="text/javascript" src="/admin/js/jquery.min.js"></script>
<!-- <script type="text/javascript" src="js/page.js" ></script> -->
</head>
<style>
	.uploadBox{
        display: none;
        width: 360px;
        margin: 30px auto 0;
    }
	.buttone{
		display: inline-block;
		padding: 1% 1.5%;
		color: white;
		background: #47a4e1;
		border: none;
		border-radius: 4px;
		position:relative;
		z-index: -1;
		font-size: 14px;
	}
	.pagination>li{
		float: left;
		text-align: center;
		border-radius: 5px;
	}
	.pagination>li:hover{
		background-color: #47a4e1;
	}
	.pagination>li:hover>span{
		color: white;
	}
	.pagination>li>a{
		display: inline-block;
		width: 66px;
		line-height: 2rem;
		border-radius: 5px;
		border: 1px solid #CCCCCC;
	}
	.pagination>li>span{
		display: inline-block;
		width: 66px;
		line-height: 2rem;
		color: #47a4e1;
		font-weight: bold;
		font-size: 18px;
	}
	.pagination>li.disabled{
		border-radius: 5px;
		border: 1px solid #CCCCCC;
	}
	.pagination{
		width:50%;
		height: 100%;
		margin: 0 auto;
	}

</style>
<body>
	<div id="pageAll">
		<div class="pageTop">
			<div class="page">
				<img src="/admin/img/coin03.png" /><span><a href="#">推广部</a>&nbsp;-&nbsp;-</span>&nbsp;推广部
			</div>
		</div>

		<div class="page">
			<!-- user页面样式 -->
			<div class="connoisseur">
				<div class="conform">
                    <div class="cfD">
                        <button type="button" class="userbtn upload" style="cursor: pointer;">导入信息</button>
                        <a href="<?php echo url('admin/spread/add'); ?>"><button class="userbtn" style="cursor: pointer;position: relative;z-index: -1">添加</button></a>
						<button type="button" onclick="delAll()" class="userbtn" style="cursor: pointer;">批量删除</button>
                    </div>
				</div>
				<!--<promotionuser 表格 显示 &ndash;&gt;-->
				<div class="conShow">
					<table border="1" cellspacing="0" cellpadding="0">
						<tr>
						<td width="60px" class="tdColor tdC"><input type="checkbox" id="allChecks" onclick="ckAll()"></td>
						<td width="66px" class="tdColor tdC">序号</td>
						<td width="100px" class="tdColor">姓名</td>
						<td width="80px" class="tdColor">性别</td>
						<td width="120px" class="tdColor">联系电话</td>
						<td width="120px" class="tdColor">应聘职位</td>
						<td width="80px" class="tdColor">学历</td>
						<td width="120px" class="tdColor">专业</td>
						<td width="180px" class="tdColor">电子邮件</td>
						<td width="150px" class="tdColor">录入时间</td>
						<td width="80px" class="tdColor">简历</td>
						<td width="200px" class="tdColor">操作</td>
						</tr>
						<?php foreach($info as $key=>$vo): ?>
						<tr height="40px">
							<td><input type="checkbox" value="<?php echo $vo['job_id']; ?>" class="asaa"  name="check"></td>
							<td><?php echo $key+1; ?></td>
							<td><?php echo $vo['job_name']; ?></td>
							<td><?php echo $vo['job_sex']; ?></td>
							<td><?php echo $vo['job_phone']; ?></td>
							<td><?php echo $vo['job_work']; ?></td>
							<td><?php echo $vo['job_education']; ?></td>
							<td><?php echo $vo['job_major']; ?></td>
							<td><?php echo $vo['job_email']; ?></td>
							<td><?php if($vo['job_createtime']==''): ?>
								暂无时间
								<?php else: ?>
								<?php echo date("Y-m-d H:i:s",$vo['job_createtime']); endif; ?>
							</td>
                            <td>
                                <?php if($vo['job_resume_pdf']==''): ?>
                                <a class="word" href="javascript:;">
                                    <img src="/admin/img/document-word.png" alt="简历"/>
                                </a>
                                <?php else: ?><a target="_blank" href="<?php echo url('admin/excelud/pdf_preview'); ?>?pdf_name='<?php echo $vo['job_id']; ?>'">
                                <img src="/admin/img/document-word-tick.png" alt="简历"/>
                                <?php endif; ?>
                            </a>
                            </td>
							</td>
							<td>
								<a class="upload_word" data-id="<?php echo $vo['job_id']; ?>" href="javascript:;">
									<button class="buttone">上传附件</button></a>
								<a class="select" onclick="detaile('<?php echo $vo['job_id']; ?>')" href="javascript:;">
									<button class="buttone">详情</button></a>
								<a class="delban" href="javascript:;" data-id="<?php echo $vo['job_id']; ?>"><button class="buttone">删除</button></a>
							</td>
						</tr>
						<?php endforeach; ?>
					</table>
					<?php if(count($info)<=0): ?>
					<p style="text-align: center;color: #999;margin-top: 5px;">暂无数据...</p>
					<?php endif; ?>
					<div class="paging" style="margin-top: 20px; height: 2rem;">
						<?php echo $info->render(); ?>
					</div>
				</div>
				<!--<promotionuser 表格 显示 end&ndash;&gt;-->
			</div>
			<!-- user页面样式end -->
		</div>

	</div>


	<!-- 删除弹出框 -->
	<!--<div class="banDel">-->
		<!--<div class="delete">-->
			<!--<div class="close">-->
				<!--<a><img src="/admin/img/shanchu.png" /></a>-->
			<!--</div>-->
			<!--<p class="delP1">你确定要删除此条记录吗？</p>-->
			<!--<p class="delP2">-->
				<!--<a id="yes" href="javascript:;" class="ok yes">确定</a><a class="ok no">取消</a>-->
			<!--</p>-->
		<!--</div>-->
	<!--</div>-->
	<!-- 删除弹出框  end-->
    <!-- 导入信息框 -->
    <div class="uploadBox" id="upload">
        <form action="<?php echo url('admin/excelud/upload_excel'); ?>" method="post" enctype="multipart/form-data" >
            <input type="file" name="excel"/>
            <input type="submit" value="导入信息" />
        </form>
    </div>
    <!-- 导入信息框 end-->
	<!-- 上传附件框 -->
	<div class="uploadBox" id="uploadword">
		<form action="<?php echo url('admin/excelud/upload_word'); ?>" method="post" enctype="multipart/form-data" >
			<input id="job_id" type="hidden" value="1" name="job_id"/>
			<input type="file" name="word"/>
			<input type="submit" value="上传附件" />
		</form>
	</div>
	<!-- 上传附件框 end-->
</body>
<script src="/admin/layer/layer.js"></script>
<script type="text/javascript">
// 广告弹出框

$(".delban").click(function(){
    var that = $(this);
	var id = that.data('id');
    // $(".banDel").show();
    layer.confirm('确认要删除吗？', function () {
        $.post('<?php echo url("admin/spread/del"); ?>',{'job_id':id},function (data) {
            // console.log(data);
            if (data == 200) {
                that.parent().parent().remove();
                layer.msg('已删除!', {icon: 1, time: 1000});
            } else{
                layer.msg('删除失败!', {icon: 5, time: 1000});
            }
        })
    });
	// $('#yes').unbind("click").click(function () {
    //     $(".banDel").hide();
    //     $.post('<?php echo url("admin/spread/del"); ?>',{'job_id':id},function (data) {
    //         if(data==200){
    //             that.parent().parent().remove();
    //             layer.msg('删除成功！',{icon: 1, time: 1000});
    //         }else{
    //             layer.msg('删除失败！',{icon: 5, time: 1000});
    //         }
    //     })
    // })
});
// $(".close").click(function(){
//   $(".banDel").hide();
// });
// $(".no").click(function(){
//   $(".banDel").hide();
// });
//删除
// 广告弹出框 end
//    导入信息弹出框
    $('.upload').click(function () {
        layer.open({
            type: 1,
            title: '导入信息',
            closeBtn: 0,
            area: ['400px', '215px'],
            shadeClose: true,
            content: $('#upload')
        });
    })
//    导入信息弹出框


$(document).on('click','.word',function () {
    // $('#job_id').val($(this).data('id'));
    // layer.open({
    //     type: 1,
    //     title: '上传简历',
    //     closeBtn: 0,
    //     area: ['400px', '215px'],
    //     shadeClose: true,
    //     content: $('#uploadword')
    // });
	layer.msg('亲~上传简历后才能查看哦',{time:1500})
})
$(document).on('click','.upload_word',function () {
     $('#job_id').val($(this).data('id'));
    layer.open({
         type: 1,
         title: '上传简历',
         closeBtn: 0,
         area: ['400px', '215px'],
         shadeClose: true,
         content: $('#uploadword')
     });
	//layer.msg('亲~上传简历后才能查看哦',{time:1500})
})
// 全选组 id 数组
var user_ids='';
var num = 0;//选中的个数
var tr_num = 0;//该页元素个数
function  groups(){
    $(".asaa").each(function(){
        tr_num++;
        if($(this).is(":checked")){
            user_ids+=$(this).val()+',';
            num++;
        }
    });
    user_ids = user_ids.substr(0,user_ids.length-1);
}
//全选js事件
function ckAll(){
    var flag=document.getElementById("allChecks").checked;
    var cks=document.getElementsByName("check");
    for(var i=0;i < cks.length;i++){
        cks[i].checked = flag;
    }
}
//	批量删除
function delAll () {
    groups();
    var data = user_ids;
    user_ids='';
    // console.log(data);
    if(data==''){
        layer.msg("请选择!");
    }else{
        layer.confirm('确认要删除吗？',function(index){
            // console.log(data);
            $.post('<?php echo url("admin/spread/del"); ?>',{'job_id':data},function (data) {
                // console.log(data);
                if (data == 200) {
                    layer.msg('已删除!', {icon: 1, time: 1000});
                    if(num==tr_num){
                        setTimeout(function () {
                            window.location.href='<?php echo url("admin/spread/spread"); ?>';
                        }, 1000);
					}else{
                        // $(".asaa").each(function(){
                        //     if($(this).is(":checked")){
                        //         $(this).parent().parent('tr').remove();
                        //     }
                        // });
                        setTimeout(function () {
                            window.location.reload();
                        }, 1000);
                        num=0;
                        tr_num=0;
					}
                } else{
                    layer.msg('删除失败!', {icon: 5, time: 1000});
                    num=0;
                    tr_num=0;
                }
            })
        });
    }
}
//查看详情
function detaile(id){
    layer.open({
        type:2,
        area: ['700px', '450px'],
        fixed: false, //不固定
        maxmin: true,
        content: "<?php echo url('admin/spread/test'); ?>?job_id="+id
    });
}


</script>
</html>